package com.hzdl.controller;

import com.hzdl.domain.Account;
import com.hzdl.service.AccountService;
import com.hzdl.service.impl.AccountServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;

import java.sql.SQLException;
import java.util.List;

@Controller
public class AccountController {

    @Test
    public void call() {
    ApplicationContext applicationContext = new ClassPathXmlApplicationContext("bean.xml");
    AccountService accountService = applicationContext.getBean("accountService", AccountServiceImpl.class);

        List<Account> all = null;
        try {
            all = accountService.findAll();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        System.out.println(all);
        System.out.println(accountService);


//        accountService.save();
    }






}
